package com.punai.dataanalysis.ng001.constants;

import cn.hutool.core.util.StrUtil;

public class Ng001Constants {

    public enum CompanyOrderEnum {
        C1("一公司", "", 1),
        C2("二公司", "", 2),
        C3("三公司", "", 3),
        C4("四公司", "", 4),
        C5("五公司", "", 5),
        C6("六公司", "", 6),
        C7("七公司", "", 7),
        C8("八公司", "", 8),
        C9("九公司", "", 9),
        C10("十公司", "", 10),
        C11("十一公司", "", 11),
        C12("青一公司", "", 12),
        C13("青二公司", "", 13),
        C14("济南六公司", "", 14),
        C15("北京公司", "", 15),
        C16("海南分公司", "", 16),
        C17("天元国际", "", 17),
        C18("烟台分公司", "", 18),
        C19("安装公司", "", 19),
        C20("轻安公司", "", 20),
        C21("消防公司", "", 21),
        C22("装饰公司", "", 22),
        C23("路一公司", "", 23),
        C24("路二公司", "", 24),
        C25("路三公司", "", 25),
        C26("直属公司", "", 26),
        C27("园林公司", "", 27),

        ;

        private String type;
        private String desc;
        private Integer order;

        CompanyOrderEnum(String type, String desc, Integer order) {
            this.type = type;
            this.desc = desc;
            this.order = order;
        }


        public String getType() {
            return type;
        }

        public void setType(String type) {
            this.type = type;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public Integer getOrder() {
            return order;
        }

        public void setOrder(Integer order) {
            this.order = order;
        }



        public static boolean validate(String input) {
            for (CompanyOrderEnum value : values()) {
                if (!StrUtil.equals(value.getType(), input)) {
                    return false;
                }
            }
            return true;
        }

        public static int getOrderForType(String type) {
            for (CompanyOrderEnum value : values()) {
                if (value.getType().equals(type)) {
                    return value.getOrder();
                }
            }
            return 99; // 如果找不到对应的type，返回一个特殊值
        }

    }

}
